package com.jueban.serviceImpl;

import com.jueban.Vo.DepartmentsVo;
import com.jueban.model.Department;
import com.jueban.repository.DepartmentRepository;
import com.jueban.service.DepartmentService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService
{
    @Autowired
    private DepartmentRepository departmentRepository;

    @Override
    public DepartmentsVo findAll()
    {
        List<Department> departments = departmentRepository.findAll();
        DepartmentsVo departmentsVo = new DepartmentsVo(departments);
        return departmentsVo;
    }

}
